<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1.展开数组
        // var arr = [1, 2, 3, 4]
        // var arr1 = [1, 2, 3]
        // var res = [...arr, ...arr1]
        // console.log(res)
        // 2.伪数组转化成数组
        // function fn() {
        //     console.log(arguments)
        //     var arr = [...arguments]
        //     console.log(arr)
        // }
        // fn(1, 2, 3, 4)
        // 3.处理不定参
        // function fn(...arg) {
        //     console.log(arguments)
        //     console.log(arg)
        // }
        // fn(1, 2, 3)
        // 4.展开对象
        let obj1 = {name: "张三",
                    age: 111
                    }
        let obj2 = {name1: "李四"}

        var a = [...obj1, ...obj2]
        console.log(a)



    </script>
</body>
</html>